package com.yuandian.business.monitor.controller;

import com.yuandian.api.business_monitor.po.DetailedListParams;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.business.monitor.service.IBusinessDetailedListService;
import com.yuandian.utils.PageDataInfo;
import com.yuandian.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 详单查询
 *
 * @author zhoutian
 * @date 2020/10/13 17:32
 */
@Slf4j
@Controller
@Api(value = "businessDetail", tags = "业务详单查询页面接口")
@RequestMapping("/business/monitoring/detail")
public class BusinessDetailedListController {
    @Autowired
    private IBusinessDetailedListService businessDetailedListService;

    /**
     * 监控查询-业务详单查询-列表
     *
     * @param params 参数
     * @return Result
     */
    @ResponseBody
	@ApiOperation("监控查询-业务详单查询-列表")
    @PostMapping("/getList")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "advancedQuery", value = "高级查询", paramType = "query", required = false, dataType = "Array"),
			@ApiImplicitParam(name = "areaCodeList", 			value = "归属城市", 			paramType = "query", 	required = false, 	dataType = "Array"),
			@ApiImplicitParam(name = "businessCodeList", 			value = "业务编码", 			paramType = "query", 	required = false, 	dataType = "Array"),
			@ApiImplicitParam(name = "dataCenter", 			value = "数据中心", 			paramType = "query", 	required = false, 	dataType = "Array"),
			@ApiImplicitParam(name = "systemId", 			value = "系统id", 			paramType = "query", 	required = true, 	dataType = "String"),
			@ApiImplicitParam(name = "startTime", 			value = "开始时间", 			paramType = "query", 	required = true, 	dataType = "String"),
			@ApiImplicitParam(name = "endTime", 			value = "结束时间", 			paramType = "query", 	required = true, 	dataType = "String"),
			@ApiImplicitParam(name = "startTimeUsec", 			value = "开始时间微妙值", 			paramType = "query", 	required = false, 	dataType = "Long"),
			@ApiImplicitParam(name = "endTimeUsec", 			value = "结束时间微妙值", 			paramType = "query", 	required = false, 	dataType = "Long"),
			@ApiImplicitParam(name = "pageNum",   			value = "页码", 				paramType = "query", 	required = true, 	dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 			value = "每页大小", 			paramType = "query", 	required = true, 	dataType = "Long"),
	})
    public R<PageDataInfo> getDetailedList(@RequestBody DetailedListParams params) {

        return R.ok(businessDetailedListService.queryList(params));
    }

}
